package cn.huiyunche.base.service.interfaces;

import cn.huiyunche.base.service.model.BArea;
import cn.huiyunche.base.service.vo.*;
import cn.huiyunche.tools.basic.exceptions.BusinessException;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface BAreaService {

    /**
     * 根据城市编码查询区县列表
     *
     * @param cityCode 城市编码
     * @return List<BArea>  list
     * @throws BusinessException the business exception
     */
    List<BArea> selectDistrictByCityCode(String cityCode) throws Exception;

    /**
     * 根据省编码查询所属城市
     *
     * @param provinceCode 省编码
     * @return List<BArea>  list
     * @throws BusinessException the business exception
     */
    List<BArea> selectCityByProvinceCode(String provinceCode) throws Exception;

    /**
     * 根据市编码查询所属区县
     *
     * @param cityCode 市编码
     * @return List<BArea>  list
     * @throws BusinessException the business exception
     */
    List<BArea> selectCountyByCityCode(String cityCode) throws Exception;

    /**
     * 查询省列表
     *
     * @return List<BArea>  list
     * @throws BusinessException the business exception
     */
    List<BArea> selectProvinceList() throws Exception;

    /**
     * 查询省列表
     *
     * @return List<BArea>  list
     * @throws BusinessException the business exception
     */
    List<BProvinceVo> selectProvinces() throws Exception;

    /**
     * 根据父级编码查询数据
     *
     * @param parentCode 父级编码
     * @return List<BArea>  list
     * @throws BusinessException the business exception
     */
    List<BArea> selectAreaByParentCode(String parentCode) throws Exception;

    /**
     * 根据编码查询数据
     *
     * @param code 编码
     * @return List<BArea>  list
     * @throws BusinessException the business exception
     */
    List<BArea> selectAreaByCode(String code) throws Exception;

    /**
     * 查询所有区域信息
     *
     * @return List<BArea>  list
     * @throws BusinessException the business exception
     */
    List<BArea> selectArea() throws Exception;

    /**
     * 查询所有区域信息（嵌套结构）
     *
     * @return list list
     * @throws BusinessException the business exception
     */
    List<ProvinceVo> selectAllArea() throws Exception;

    /**
     * Gets city coefficient by code.
     *
     * @param code 城市code
     * @return city coefficient by code
     * @Title: getCityCoefficientByCode
     * @Description: 根据城市获取城市级别系数
     * @return: BigDecimal
     */
    BigDecimal getCityCoefficientByCode(String code);

    /**
     * Gets full by code.
     *
     * @param cityCode the city code
     * @return full by code
     * @Title: getProvinceAndCityByCityCode
     * @Description: 根据区域编码返回完整地址
     * @return: String
     */
    String getFullByCode(String cityCode);

    /**
     * Gets province and city like city name.
     *
     * @param cityName 城市名
     * @return province and city like city name
     * @Title: getProvinceAndCityLikeCityName
     * @Description: 根据城市code返回省 +城市名称
     * @return: BArea
     */
    BArea getProvinceAndCityLikeCityName(String cityName);

    /**
     * 根据编码 和 城市级别查询城市
     *
     * @param code  the code
     * @param level the level
     * @return b area
     */
    BArea selectAreaByCodeAndLevel(String code, String level);

    /**
     * 根据拼音首字母查询省市区
     *
     * @return list list
     */
    List<BArea> selectAreaByPinyin();

    /**
     * 查询所有城市
     *
     * @return list list
     * @throws Exception the exception
     */
    List<BArea> selectCity() throws Exception;

    /**
     * 查询省市 城市级别
     *
     * @param page              the page
     * @param bAreaCityRatingVo the b area city rating vo
     * @return map map
     */
    Map<String, Object> selectCityRatingList(PageVo page, BAreaCityRatingVo bAreaCityRatingVo);

    /**
     * 更新省市 城市级别
     *
     * @param bAreaCityRatingVo the b area city rating vo
     * @return result result
     */
    Result<String> updateCityRating(BAreaCityRatingVo bAreaCityRatingVo);

    /**
     * 根据市 查询省
     *
     * @param citycode the citycode
     * @return b area
     */
    BArea selectProByCityCode(String citycode);

    /**
     * 生成拼音
     *
     * @return int int
     */
    int generatePinyin();

    /**
     * 生成首字母
     *
     * @return int int
     */
    int generateFirstSpell();

    /**
     * 根据首字母、拼音、中文、编码查询区域信息
     *
     * @param code     the code
     * @param isVeneer the isVeneer
     * @param params   the params
     * @return list list
     * @throws Exception the exception
     */
    List<BAreaSearchVo> selectBArea(String code, String params, Boolean isVeneer) throws Exception;

    /**
     * 查询省下所有市县
     *
     * @param code the code
     * @return list list
     */
    List<BCityVo> selectCounties(String code);

    /**
     * 根据省市区县模糊查询
     *
     * @param provinceName the province name
     * @param cityName     the city name
     * @param countyName   the county name
     * @return list list
     */
    List<BAreaSearchVo> selectLikename(String provinceName, String cityName, String countyName);

    /**
     * 为人送车提供区域选择
     *
     * @param params the params
     * @return list list
     * @throws BusinessException the business exception
     */
    List<BArea> selectBareaByParams(String params) throws Exception;

    /**
     * Gets intracity city list.
     * 查询已开通同城配送城市列表
     *
     * @return the intracity city list
     */
    List<BArea> getIntracityCityList();

    /**
     * Select parent by child b area.
     *
     * @param childCode the child code
     * @return the b area
     */
    BArea selectParentByChild(String childCode) throws Exception;
}
